
package sceneInfo;

/**
 *
 *	This class holds visual information about line
 *
*/

public class LineInfo extends ObjectInfo
{

	private static final long serialVersionUID = 1L;
	
	private char m_kind;  // l|r|t|b

	public LineInfo()
	{
		super("line");
		m_kind = ' ';
	}

	public LineInfo(char kind)
	{
		super("line");
		testKind(kind);
		m_kind = kind;
	}
	
	public char getKind() {
		return m_kind;
	}

	public void setKind(char kind) {
		testKind(kind);
		this.m_kind = kind;
	}
	
	private void testKind(char kind){
		if(kind != 'l' && kind != 'r' && kind != 't' && kind != 'b' && kind != ' '){
			throw new IllegalArgumentException("The flag must be 'l', 'r', 'b', 't' or ' '");
		}
	}
	
	public String toString(){
		return "[Line (" + m_kind+") at "+ getDistance()+"m in dir:"+getDirection()+"]";
	}
}

